<%@ page import="java.util.ArrayList" %>
<%@ page import="com.itheima.el.Student" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    ArrayList<Student> list = new ArrayList<>();
    Student stu=new Student("张三",23);
    Student stu2=new Student("李四",23);
    list.add(stu);
    list.add(stu2);
    pageContext.setAttribute("list", list);
%>

<table border="1" align="center"width="80%">
    <tr style="color: red">
        <th>姓名</th>
        <th>年龄</th>
    </tr>
<c:forEach items="${list}" var="s">
    <tr style="text-align: center">
        <td> ${s.name}</td>
        <td> ${s.age}</td>
    </tr>
</c:forEach>
</table>
</body>
</html>
